using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using ProxyServer.Certs;
using ProxyServer.EntityFrameworkCore.ValueConverts;

namespace ProxyServer.EntityFrameworkCore.Sqlite;


public class CertificateInfoEntityTypeConfiguration : IEntityTypeConfiguration<CertificateInfo>
{
    public void Configure(EntityTypeBuilder<CertificateInfo> builder)
    {
        builder.HasKey(x => x.Id);
        builder.Property(x => x.Expires).HasConversion(SqliteTicksValueConverter.Instance);
        builder.Property(x => x.CreatedTime).HasConversion(SqliteTicksValueConverter.Instance);
    }
}